package com.niit.realtime.controller;


import com.niit.realtime.service.StatsService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/")
public class StatsController {

    private final StatsService statsService;

    public StatsController(StatsService statsService) {
        this.statsService = statsService;
    }

    @GetMapping("/get_all_stats")
    public StatsService.StatsData getAllStats() {
        return statsService.getAllStats();
    }

    @GetMapping("/health")
    public String healthCheck() {
        return "Real-time Stats Service is running";
    }
}